Skip to main content

Report tasks API

General notes

Embeddable fields

NameTypeDescription
total_time_reportedintReturns total amount of minutes for current task in time reports.

Content

Report tasks collection:

Single report task:

Report tasks collection

Report tasks index

This method needs permission access on report-tasks

Request

Index behaviourDefinition
Paginated by defaultYes
Sortingid, report_id, name, is_bug, estimated_time, reported_time, to_invoice_time, to_invoice_price, status_id, task_id, note, created_at, updated_at
Filtersid:enum, report_id:int, name:string, to_invoice_price:float, is_bug:bool, estimated_time:int, reported_time:int, to_invoice_time:int, to_invoice_price:float, status_id:int, note:sring, created_at:date, updated_at:date
Embedded-
GET /api/v0/report-tasks HTTP/1.1
Content-Type: application/json

Responses

200 OK

GET /api/v0/report-tasks HTTP/1.1
Content-Type: application/json

{
"items": [
{
"id": 25,
"report_id": 11,
"name": "test3",
"is_bug": false,
"estimated_time": 0,
"reported_time": 780,
"to_invoice_time": 780,
"to_invoice_price": 6500,
"status_id": 15,
"task_id": 65,
"note": null,
"created_at": "2023-01-11T15:46:49+0100",
"updated_at": "2023-01-11T15:46:49+0100",
"_links": [
{
"href": "/api/v0/report-tasks/25",
"rel": "self",
"type": "GET"
}
]
}
],
"_meta": {
"page": 1,
"total_pages": 6,
"records": 6,
"per_page": 1
}
}

Single report task

Report task detail

GET /api/v0/report-tasks/{report_task_id}

This method needs permission read on report-tasks.

Get ReportTask detail.

Request

Index behaviourDefinition
Embedded-

Request

GET /api/v0/report-tasks/11 HTTP/1.1
Content-Type: application/json

Response

200 OK

GET /api/v0/report-tasks/11 HTTP/1.1
Content-Type: application/json

{
"id": 25,
"report_id": 11,
"name": "test3",
"is_bug": false,
"estimated_time": 0,
"reported_time": 780,
"to_invoice_time": 780,
"to_invoice_price": 6500,
"status_id": 15,
"task_id": 65,
"note": null,
"created_at": "2023-01-11T15:46:49+0100",
"updated_at": "2023-01-11T15:46:49+0100",
"_links": [
{
"href": "/api/v0/report-tasks/25",
"rel": "self",
"type": "GET"
}
]
}

404 NOT FOUND

ReportTask was not found.

GET /api/v0/report-tasks/50 HTTP/1.1
Content-Type: application/json
Status-Code: 404

{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}

Update report task

PUT/PATCH /api/v0/report-tasks/{report_task_id}

This method needs permission update on report-tasks.

Method for updating ReportTask data.

Request

ParamTypeDescriptionRequirements
to_invoice_timeintReport task to invoice time in minutesRequired.
to_invoice_pricefloatReport to invoice priceRequired.
is_hidden_for_clientbooleanindicates if task should be hidden in public viewRequired.

For PATCH method any field can be omitted.

PATCH /api/v0/report-tasks/1 HTTP/1.1
Content-Type: application/json

{
"to_invoice_time": 120,
"is_hidden_for_client": true
}

Response

200 OK

ReportTask successfully updated.

PATCH /api/report-tasks/25 HTTP/1.1
Content-Type: application/json

{
"id": 25,
"report_id": 11,
"name": "test3",
"is_bug": false,
"estimated_time": 0,
"reported_time": 780,
"to_invoice_time": 120,
"to_invoice_price": 1000,
"status_id": 15,
"task_id": 65,
"note": null,
"created_at": "2023-01-11T15:46:49+0100",
"updated_at": "2023-01-13T14:32:47+0100",
"_links": [
{
"href": "/api/v0/report-tasks/25",
"rel": "self",
"type": "GET"
}
]
}

404 NOT FOUND

ReportTask was not found.

PUT /api/v0/report-tasks/2 HTTP/1.1
Content-Type: application/json
Status-Code: 404

{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}

422 UNPROCESSABLE ENTITY

Validation error occurred.

PUT /api/v0/report-tasks/2 HTTP/1.1
Content-Type: application/json

{
"type" : "ValidationError",
"message" : "The given data was invalid.",
"id" : "fe1b04de-b347-43b5-8118-864c1eefaccf",
"errors": [
{
"field": "to_invoice_time",
"message": "The to_invoice_time field is required."
}
]
}

Delete report task

DELETE /api/v0/report-tasks/{report_task_id}

This method needs permission delete on report-tasks.

Method for deleting ReportTask.

Request

DELETE /api/v0/report-tasks/1 HTTP/1.1
Content-Type: application/json

Response

204 NO CONTENT

ReportTask successfully deleted.

404 NOT FOUND

ReportTask was not found.

DELETE /api/v0/report-tasks/1 HTTP/1.1
Content-Type: application/json
Status-Code: 404

{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}